#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include <stdlib.h>

int main()
{
	int arr[4] = { 1,2,3,4 };
	int raa[5] = { 5,6,7,8,9 };
	int ddd[100] = { 0 };
	int szarr = sizeof(arr)/sizeof(arr[0]);
	int szraa = sizeof(raa) / sizeof(raa[0]);
	int count = 0;
	int i = 0;
	int j = 0;
	while (i < szarr && j < szraa)
	{
		if (arr[i] < raa[j])
		{
			ddd[count++] = arr[i++];
		}
		else
			ddd[count++] = raa[j++];
	}
	while (i < szarr)
	{
		ddd[count++] = arr[i++];
	}
	while (j < szraa)
	{
		ddd[count++] = raa[j++];
	}
	for (int h = 0; h < count; h++)
	{
		printf("%d ", ddd[h]);
	}
	return 0;
}